home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / String / tests / top_minus.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  853b  |  54 lines

  1. #include "test.h"
  2.  
  3. void Minus()
  4. {
  5. String s1("abcd");
  6. String s2;
  7.  
  8. s1="abcd";
  9.  
  10. Assert( (s1-=1)=="abc");    s1.VERIFY();
  11. Assert( (s1-=10)=="abc");    s1.VERIFY();
  12.  
  13. Assert( (s1-='c')=="ab");    s1.VERIFY();
  14. Assert( (s1-='z')=="ab");    s1.VERIFY();
  15.  
  16. s1="abcd";
  17.  
  18. Assert( (s1-="cd")=="ab");    s1.VERIFY();
  19. Assert( (s1-="qz")=="ab");    s1.VERIFY();
  20.  
  21. s1="abcd"; s2="cd";
  22. Assert( (s1-=s2)=="ab");    s1.VERIFY();
  23. s2="qz";
  24. Assert( (s1-=s2)=="ab");    s1.VERIFY();
  25.  
  26. s1="abcd1234";
  27.  
  28. Assert( (s1-=SSint)=="abcd");    s1.VERIFY();
  29. Assert( (s1-=SSint)=="abcd");    s1.VERIFY();
  30.  
  31.  
  32. s1="abcd";
  33.  
  34. Assert( (s1-1)=="abc");
  35. Assert( (s1-10)=="abcd");
  36.  
  37. Assert( (s1-'d')=="abc");
  38. Assert( (s1-'z')=="abcd");
  39.  
  40. s1="abcd";
  41.  
  42. Assert( (s1-"cd")=="ab");
  43. Assert( (s1-"qz")=="abcd");
  44.  
  45. s1="abcd"; s2="cd";
  46. Assert( (s1-s2)=="ab");
  47. s2="qz";
  48. Assert( (s1-s2)=="abcd");
  49.  
  50. s1="abcd             ";
  51. Assert( (s1-SSwhite)=="abcd");
  52.  
  53. }
  54.